package com.sbs.gaoxinqutoilet.adapter;

import android.view.View;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sbs.gaoxinqutoilet.R;
import com.sbs.gaoxinqutoilet.entity.HomeMenuEntity;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by 聪明一只哈 on 2018/6/7.
 * Time: 2018/6/7  17:35
 */

public class HomeMenuAdapter  extends BaseQuickAdapter<HomeMenuEntity,HomeMenuAdapter.HomeMenuViewHolder> {


    public HomeMenuAdapter(@LayoutRes int layoutResId, @Nullable List<HomeMenuEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(HomeMenuViewHolder helper, HomeMenuEntity item) {

        //这里的图片宽高设为了固定值,后期可能会改
        helper.setText(R.id.tv_title_home_menu, item.getFunc_name());
        switch(item.getFunc_id()){
//            case "户厕档案查询录入":
//            case "户厕改造档案":
            case "201":
                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.file);
                break;
            //case "施工记录信息采集":
            case "205":
                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.home_shigong);
                break;
            //case "户厕改造验收":
            case "202":
                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.acceptance);
                break;
//            case "户厕改造重建":
//            case "抽检不通过":
//                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.home_rebuild);
//                break;
           // case "户厕改造检查":
            case "401":
                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.filecheck);
                break;


            case "306":
                helper.getView(R.id.image_home_menu).setBackgroundResource(R.drawable.tongji);
                break;

            default:
            
                break;
        }


    }

    public class HomeMenuViewHolder extends BaseViewHolder {

        public HomeMenuViewHolder(View view) {
            super(view);
            AutoUtils.auto(view);
        }
    }
}
